// 百度地图API功能
var map = new BMap.Map("allmap");
var point = new BMap.Point(lng,lat);
map.centerAndZoom(point,12);
var mk = new BMap.Marker(point);
map.addOverlay(mk);
var geoc = new BMap.Geocoder();
geoc.getLocation(point, function(rs){
    var addComp = rs.addressComponents;
    var stress=addComp.province;
    if(addComp.city != ""){
        stress += ", " + addComp.city;
    }
    if(addComp.district != ""){
        stress += ", " + addComp.district;
    }
    if(addComp.street != ""){
        stress += ", " + addComp.street;
    }
    if(addComp.streetNumber != ""){
        stress += ", " + addComp.streetNumber;
    }
    $("#address").text(stress);
});
//方向处理
if(direct >= 348.76 && direct <= 360){
	$("#direct").text("北")
}else if(direct >= 0 && direct <= 11.25){
	$("#direct").text( "北");
}else if(direct >= 11.26 && direct <= 33.75){
	$("#direct").text( "偏北");
}else if(direct >= 33.76 && direct <= 56.25){
	$("#direct").text( "东北");
}else if(direct >= 56.26 && direct <= 78.75){
	$("#direct").text( "偏东");
}else if(direct >= 78.76 && direct <= 101.25){
	$("#direct").text( "东");
}else if(direct >= 101.26 && direct <= 123.75){
	$("#direct").text( "偏东");
}else if(direct >= 123.76 && direct <= 146.25){
	$("#direct").text( "东南");
}else if(direct >= 146.26 && direct <= 168.75){
	$("#direct").text( "偏南");
}else if(direct >= 168.76 && direct <= 191.25){
	$("#direct").text( "南");
}else if(direct >= 191.26 && direct <= 213.75){
	$("#direct").text( "偏南");
}else if(direct >= 213.76 && direct <= 236.25){
	$("#direct").text( "西南");
}else if(direct >= 236.26 && direct <= 258.75){
	$("#direct").text( "偏西");
}else if(direct >= 258.76 && direct <= 281.25){
	$("#direct").text( "西");
}else if(direct >= 281.26 && direct <= 303.75){
	$("#direct").text( "偏西");
}else if(direct >= 303.76 && direct <= 326.25){
	$("#direct").text( "西北");
}else if(direct >= 326.26 && direct <= 348.75){
	$("#direct").text( "偏北");
}